Declare documented API public (downstream ExplicitImports)#1498
Declare documented API public (downstream ExplicitImports)#1498ChrisRackauckas-Claude wants to merge 3 commits into
Conversation
Mark Catalyst's documented-but-not-exported names as `public` via the existing `SciMLPublic.@public` mechanism, so downstream packages that qualified-access these names (`Catalyst.name`) pass ExplicitImports' check_all_qualified_accesses_are_public. Only names that are defined in src, documented (docstring and/or docs/src), and not already exported are publicized. Bumps patch version. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
`hasdescription`, `getdescription`, `hasmisc`, `getmisc` are exported into Catalyst's namespace through `@reexport using ModelingToolkitBase`, so declaring them `public` is a load error: cannot declare Catalyst.hasdescription public; it is already declared exported The original export-scan only parsed Catalyst's own `src/` `export` lines and missed reexported names. Remove the four reexport-exported names from the `@public` additions; the remaining 21 documented, non-exported names stay. Verified `using Catalyst` loads cleanly on Julia 1.12. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
The metadata-survives-complete() bug (issue SciML#1353) is fixed upstream in ModelingToolkitBase: getmetadata(complete(rs2), MiscSystemData, nothing) now correctly returns ones(2, 3). The @test_broken was reporting an Unexpected Pass and erroring the Modeling test group. Verified locally on Julia 1.12 that the assertion now holds. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
5a916d9 to
bf48907
Compare
Rebase + CI status update (automated)Rebased onto current Modeling lane red — two pre-existing, upstream-driven failures (not caused by this PR)The
The Net: the |
Summary
Marks Catalyst's documented-but-not-exported API names as
public(via the existingSciMLPublic.@publicmechanism already used insrc/Catalyst.jl), so they participate in Julia's public-symbol metadata. Exported names are already public; this PR targets only names that downstream packages reach via qualified access (Catalyst.name).Rationale (downstream ExplicitImports)
Downstream SciML packages run ExplicitImports'
check_all_qualified_accesses_are_public, which flags anyCatalyst.nameaccess wherenameis not declaredpublic(and not exported). Several documented Catalyst accessors/predicates/types are accessed this way downstream but were neither exported nor@public, so they were flagged. Declaring thempublicresolves those findings without changing Catalyst's exported surface.Selection criteria
A name was publicized only if it is (defined in
src/) AND (documented — has a docstring and/or appears indocs/src, including@docsAPI-reference blocks) AND (not already exported, including via the@reexport using ModelingToolkitBasereexport) AND (not already@public) AND (Catalyst-owned, i.e. not re-imported from another module).Names publicized (21)
Grouped next to their relevant include in
src/Catalyst.jl:Reactionpredicates / metadata accessors:isbc,isconstant,isvalidreactant,hasnoisescaling,getnoisescalingReactionSystem/ReactionComplextypes and accessors:ReactionComplex,ReactionComplexElement,get_species,get_rxs,get_networkproperties,reset_networkproperties!symmap_to_varmapcyclesDiscreteSpaceReactionSystemaccessors:reactionsystem,spatial_reactions,num_verts,num_edges,num_species,dspace,edge_iterator,is_transport_systemAll explicitly-requested downstream-flagged candidates are included:
symmap_to_varmap,get_networkproperties,cycles(all defined + documented + not exported).Removed because already exported (4)
The first revision of this PR incorrectly declared four reaction-metadata accessors
public. They are already exported into Catalyst's namespace via@reexport using ModelingToolkitBase(ModelingToolkitBase exports them), and Julia forbids declaring an already-exported namepublic:Removed from the
@publicadditions (verified exported by queryingnames(ModelingToolkitBase)and confirmedBase.isexported(Catalyst, n) == trueafter load):hasdescription,getdescription,hasmisc,getmiscThese are public already (export ⟹ public), so downstream ExplicitListing checks are unaffected. The export-scan that produced the original list missed them because they are not
exported in Catalyst's ownsrc/— they enter the namespace through the ModelingToolkitBase reexport.Considered and skipped (with reasons)
assemble_oderhs— defined insrc/reactionsystem_conversions.jl, but has no docstring and appears only indocs/unpublished/pdes.md(not indocs/src). Internal-only by the documentation criterion → skipped.flatten— referenced in docs, but it is imported fromModelingToolkitBase(import ModelingToolkitBase: ... flatten ...insrc/Catalyst.jl), i.e. not a Catalyst-owned name → skipped (publicity is the owning module's responsibility).ModelingToolkitBase,SymbolicIndexingInterface— these are module references in@docs/docs, not Catalyst-owned API names → skipped.adjacencymat,deficiency,subnetworks,grid_dims,grid_size, and the bulk of the@docslist) —exportalready makes them public → not touched.@publicnames (unit-validation APIs,U0Map/ParameterMapand their accessors) — left as-is.Verification
Loaded on Julia 1.12 (
julia +1.12 --project=. -e 'using Catalyst'): precompiles and loads cleanly with no "already declared exported" error (CATALYST LOADED OK). Post-loadBase.ispublic/Base.isexportedconfirm the 21 kept names arepublic+ not exported, and the 4 removed names are exported (so correctly left undeclared).Mechanism / dependency
No new dependency added. Catalyst already depends on
SciMLPublic([deps]+[compat] = "1") and already usesimport SciMLPublic: @publicwith several@publicblocks; this PR appends to that existing mechanism. Patch version bumped16.2.0→16.2.1.This PR should be ignored until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code